$(function () {
    window.onload = function () {
        // 最新请求
        $.ajax({
            url: 'http://localhost:3000/guid/new',
            type: 'get',
            success: function (pla) {
                console.log(pla);
                var plarr = '';
                $.each(pla, function (i, item) {
                    plarr += '<li>' + '<img class = "img1" src =' + item.img + '><p> ' + item.text + '</p><span class = "simg"><img src = "../img/small/reply.png">' + item.like + '</span><span class = "simg"><img src = "../img/small/xin.png">' + item.words + '</span><img class="listbg" src="../img/small/listbg.jpg"></li >'
                    // $.each(pla[i], function (index, dom) {

                    // })

                })
                $('.ku-play-ul').append(plarr);
            }
        });
        //最热
        $.ajax({
            url: 'http://localhost:3000/guid/hot',
            type: 'get',
            success: function (res) {
                console.log(res);
                var harr = '';
                $.each(res, function (i, item) {
                    harr += '<li>' + '<img class = "img1" src =' + item.img + '><p> ' + item.text + '</p><span class = "simg"><img src = "../img/small/reply.png">' + item.like + '</span><span class = "simg"><img src = "../img/small/xin.png">' + item.words + '</span><img class="listbg" src="../img/small/listbg.jpg"></li >'
                    // $.each(pla[i], function (index, dom) {

                    // })

                })
                $('.ku-play-ul-1').append(harr);
            }
        });
    }
    // 跳转页面
    $('.ku-play-ul,.ku-play-ul-1').children('li').click(function () {
        window.location.href = '../guid/shopdetail.html';
    })
})